{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Example of Digital Phantoms that can be programmatically generated"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tomolab as tl\n",
    "from tomolab.Visualization.Visualization import TriplanarView\n",
    "from tomolab.Visualization.Visualization import VolumeRenderer\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "res = (500/128,500/128,500/47)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CYLINDER PHANTOM"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "activity = tl.DataSources.Synthetic.Shapes.uniform_cylinder(\n",
    "    shape=(128, 128, 47),\n",
    "    size=(500, 500, 500),\n",
    "    center=(250, 250, 250),\n",
    "    radius=150,\n",
    "    length=400,\n",
    "    inner_value=1.0,\n",
    "    outer_value=0.0,\n",
    "    axis=2,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABGoAAAFmCAYAAAA1TXzaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAATTUlEQVR4nO3de4yld1kH8O8jKyDlJhaKW6BEoogS2ECQkoAYIdmQqKAxRNC2GC8xEU2F4hURCAIhBDcqxERDqUJBjGgExcWgBoJYQ3GDxBs0AbTbQlss0AJF688/3vfQad2Zvc3M+5yZzyeZZM7tPb/dOXt+s9/zPM9bY4wAAAAAsLyvWXoBAAAAAEwENQAAAABNCGoAAAAAmhDUAAAAADQhqAEA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qagAAANg2qmxOjcoZNqOiBgAAAKAJQQ0AAABAE1qfAAAA2FEna/PZq61R2ps4EypqAAAAAJoQ1AAAAAA0ofUJAACARZ1Ji9But0tpY2K3qKgBAAAAaEJFDQAAAGvndCtcLh1XJ0mOXKkyht5U1AAAAAA0IagBAAAAaEJQAwAAANCEoAYAAACgCUENAAAAQBOCGgAAAIAmBDUAAAAATQhqAAAAAJoQ1AAAAAA0IagBAAAAaEJQAwAAANCEoAYAAACgCUENAAAAQBOCGgAAAIAmBDUAAAAATQhqAAAAAJoQ1AAAAAA0IagBAAAAaEJQAwAAANCEoAYAAACgCUENAAAAQBOCGgAAAIAmBDUAAAAATQhqAAAAAJoQ1AAAAAA0IagBAAAAaEJQAwAAANCEoAYAAACgCUENAAAAQBOCGgAAAIAmBDUAAAAATQhqAAAAAJoQ1AAAAAA0IagBAAAAaEJQAwAAANCEoAYAAACgCUENAAAAQBOCGgAAAIAmDiy9gHVx+OChpZdAkkvH1UmSI1f6eQC92CeWZ48AAPYCFTUAAAAATQhqAAAAAJoQ1AAAAAA0IagBAAAAaEJQAwAAANCEoAYAAACgCUENAAAAQBOCGgAAAIAmBDUAAAAATQhqAAAAAJoQ1AAAAAA0IagBAAAAaEJQAwAAANCEoAYAAACgCUENAAAAQBOCGgAAAIAmBDUAAAAATQhqAAAAAJoQ1AAAAAA0IagBAAAAaEJQAwAAANCEoAYAAACgCUENAAAAQBOCGgAAAIAmBDUAAAAATQhqAAAAAJoQ1AAAAAA0UWOMzW+suiHJJ3dvOQBr44IxxgOXXsTS7BMAm7JPxD4BsIVN94ktgxoAAAAAdo/WJwAAAIAmBDUAAAAATQhqAAAAAJoQ1AAAAAA0IagBAAAAaOL/AK83iXj+ICzIAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 1440x648 with 3 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "activity.display(res = res)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/opt/conda/lib/python3.7/site-packages/ipyvolume/serialize.py:81: RuntimeWarning: invalid value encountered in true_divide\n",
      "  gradient = gradient / np.sqrt(gradient[0]**2 + gradient[1]**2 + gradient[2]**2)\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5efa529ee0df42caaf4da0812c831317",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "VBox(children=(VBox(children=(HBox(children=(Label(value='levels:'), FloatSlider(value=0.1, max=1.0, step=0.00…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "VolumeRenderer(activity,res=res).display()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# SPHERE PHANTOM"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "activity = tl.DataSources.Synthetic.Shapes.uniform_sphere(\n",
    "    shape=(128, 128, 47),\n",
    "    size=(500, 500, 500),\n",
    "    center=(250, 250, 250),\n",
    "    radius=150,\n",
    "    inner_value=1.0,\n",
    "    outer_value=0.0,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABGoAAAFmCAYAAAA1TXzaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAUVklEQVR4nO3de6zkZ1kH8O8jKyB3EShuuUWiiBLYQBBIQIyQbEhU0BgiaFuMl5iIBqF4RQSCQAjBRoWYSLgoFMSIRlAsBjUQxBqKDRJvQAJol0IpFmiBovX1j98ce1rPOXv2XOb3zMznk2yyZ2bOzLu7s/Psfu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AANCGoAQAAAGhCUAMAAADQhKAGAAAAoAlBDQAAAEATghoAAACAJgQ1AAAAAE0IagAAAACaENQAAAAANCGoAQAAAGiixhi7X1l1TZJPLG85ACvj/mOMe869iLmZEwC7MidiTgDsYdc5sWdQAwAAAMDy2PoEAAAA0ISgBgAAAKAJQQ0AAABAE4IaAAAAgCYENQAAAABN/C9bdk+V138YKQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1440x648 with 3 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "activity.display(res = res)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "fdb526f21ed44cc59c04bfef1a55c86d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "VBox(children=(VBox(children=(HBox(children=(Label(value='levels:'), FloatSlider(value=0.1, max=1.0, step=0.00…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "VolumeRenderer(activity,res=res).display()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# SPHERES RING PHANTOM"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "activity = tl.DataSources.Synthetic.Shapes.uniform_spheres_ring(\n",
    "    shape=(128, 128, 47),\n",
    "    size=(500, 500, 500),\n",
    "    center=(250, 250, 250),\n",
    "    ring_radius=170,\n",
    "    min_radius=20,\n",
    "    max_radius=60,\n",
    "    N_elems=8,\n",
    "    inner_value=1.0,\n",
    "    outer_value=0.0,\n",
    "    axis=2,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABGoAAAFmCAYAAAA1TXzaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxI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ZLc6922hPl/tmt59LZxo1AAAAAE1o1AAAAKxQ101cbwnth+Np2e91nfdT96PD0agBAAAAaEJQAwAAANCE0ScAAIA16LKJ60Ftc0xlCj+fg9r5vUxh9Oco41BT+P6mSKMGAAAAoAmNGgAAgDXrusGwRgTLuF9sl0YNAAAAQBOCGgAAAIAmjD4BAABsyG4jJZsYiTLOAtOgUQMAAADQhEYNAADAlu3VdrklbRutGZg+jRoAAACAJgQ1AAAAAE0YfQIAAGjMOBOcLBo1AAAAAE0IagAAAACaENQAAAAANCGoAQAAAGhCUAMAAADQhKAGAAAAoAlBDQAAAEATghoAAACAJgQ1AAAAAE1csO0TAAAA4GQ7c+p0kuSK8+e2fCZHt/he4LA0agAAAACaENQAAAAANCGoAQAAAGhCUAMAAADQhM2EAQAAaGHnRrxT21jYJsKsikYNAAAAQBOCGgAAAIAmjD4BAADQzmKUqPMIlHEn1kGjBgAAAKAJQQ0AAABAE0afAAAAaKvbK0EZd2LdNGoAAAAAmtCoAQAAYBK22a7RpGFTNGoAAAAAmhDUAAAAADRh9AkAAIDJ2WsU6TBjUUab6EKjBgAAAKAJjRoAAACOlWXtmEvHVUmSs5drztCbRg0AAABAE4IaAAAAgCYENQAAAABNCGoAAAAAmhDUAAAAADQhqAEAAABoQlADAAAA0ISgBgAAAKAJQQ0AAABAE4IaAAAAgCYENQAAAABNCGoAAAAAmhDUAAAAADQhqAEAAABoQlADAAAA0ISgBgAAAKAJQQ0AAABAE4IaAAAAgCYENQAAAABNCGoAAAAAmhDUAAAAADQhqAEAAABoQlADAAAA0ISgBgAAAKAJQQ0AAABAEzXG2P2DVdcm+ejmTgdgMu47xrj7tk9i26wTALuyTsQ6AbCHXdeJPYMaAAAAADbH6BMAAABAE4IaAAAAgCYENQAAAABNCGoAAAAAmhDUAAAAADTxfwnW1Lm7FbU/AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 1440x648 with 3 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "activity.display(res = res)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "eb4e5078550946fda3e27e2bdd40cfe6",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "VBox(children=(VBox(children=(HBox(children=(Label(value='levels:'), FloatSlider(value=0.1, max=1.0, step=0.00…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "VolumeRenderer(activity,res=res).display()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CYLINDERS RING PHANTOM"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "activity = tl.DataSources.Synthetic.Shapes.uniform_cylinders_ring(\n",
    "    shape=(128, 128, 47),\n",
    "    size=(500, 500, 500),\n",
    "    center=(250, 250, 250),\n",
    "    ring_radius=170,\n",
    "    length=400,\n",
    "    min_radius=20,\n",
    "    max_radius=60,\n",
    "    N_elems=8,\n",
    "    inner_value=1.0,\n",
    "    outer_value=0.0,\n",
    "    axis=2,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABGoAAAFmCAYAAAA1TXzaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAVZklEQVR4nO3de4xkaVkG8OeVUZC7CCzOcotEEUWYQBBIQIyQTEhU0Bgi6O5ivMRENCssXhGBIBBCcKJCTDRcFBbEiEZQHAxqIIhrWJwg8QYkgO6wuLu4wC6w6Pr5R1WZWuzbdHfVeav790smmenqPvVVTZ3+Zp5+3lM1xggAAAAA0/uK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DQAAAC0st1E2rV2jScNh0agBAAAAaEJQAwAAANCEoAYAAACgCUENAAAAQBOCGgAAAIAmvOsTAAAA7Wz1Lkod3gnKuzuxaho1AAAAAE1o1AAAALARltss627XaNKwLho1AAAAAE0IagAAAACaaDH6pEIGm8m5y2HxWoLN5NwFprTKiw37/saUNGoAAAAAmmjRqAEAAICD2qkJc/m4Okly5kptGXrTqAEAAABoQlADAAAA0ISgBgAAAKAJQQ0AAABAE4IaAAAAgCYENQAAAABNCGoAAAAAmhDUAAAAADQhqAEAAABoQlADAAAA0ISgBgAAAKAJQQ0AAABAE4IaAAAAgCYENQAAAABNCGoAAAAAmhDUAAAAADQhqAEAAABoQlADAAAA0ISgBgAAAKAJQQ0AAABAE4IaAAAAgCYENQAAAABNCGoAAAAAmhDUAAAAADQhqAEAAABoosYY299YdV2Sj69vOQAb4wFjjHtNvYip2ScAtmWfiH0CYAfb7hM7BjUAAAAArI/RJwAAAIAmBDUAAAAATQhqAAAAAJoQ1AAAAAA0IagBAAAAaOJ/AQzphQbwX0PiAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 1440x648 with 3 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "activity.display(res = res)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "e716f7ef693144b59d30a1c04642b0df",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "VBox(children=(VBox(children=(HBox(children=(Label(value='levels:'), FloatSlider(value=0.1, max=1.0, step=0.00…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "VolumeRenderer(activity,res=res).display()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# COMPLEX PHANTOM"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "activity = tl.DataSources.Synthetic.Shapes.complex_phantom(\n",
    "    shape=(128, 128, 47),\n",
    "    size=(500, 500, 500),\n",
    "    center=(250, 250, 250),\n",
    "    radius=180,\n",
    "    insert_radius=120,\n",
    "    hole_radius=50,\n",
    "    length=450,\n",
    "    insert_length=225,\n",
    "    insert_min_radius=10,\n",
    "    insert_max_radius=40,\n",
    "    insert_N_elems=8,\n",
    "    inner_value=1.0,\n",
    "    insert_value=1.0,\n",
    "    outer_value=0.0,\n",
    "    axis=2,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABGoAAAFmCAYAAAA1TXzaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAXTklEQVR4nO3deaykaVUH4N/RUVBwVERQRoTY44IbRKI0CYpRE2LigkZtRQGNSyZxieMubkhwNP7hTNzSiUZEEWmJaNyjQY1G6VFRo8Z1mrCIjDOgwwAKKr7+UVWmZubut6q+U1XPk3TSt6pufe+99dV9u8/9nfPVGCMAAAAATO9dpl4AAAAAADMKNQAAAABNKNQAAAAANKFQAwAAANCEQg0AAABAEwo1AAAAAE0o1LA1quoTq+ofVvycr66qT1vlcwKwO+wTALujqp5TVT95wsf+dFU9f91rgoMo1LAWVfWUqvrjqnpzVf1bVf1RVX38eZ5zjPGHY4wPXzrGff7xXFWPrapRVded5zgAbEZVPaOq/qyq3lpVb6iq36yqp0y9LgC2Q1X9flX9e1U96CSPH2PcMsb4inWvC85LoYaVq6rrk/xakh9J8rAkNyT53iTvmHJdAPRRVd+Q5LYktyR5ZJIPTvLjST77lM+jOA+wh6rqsUk+MclI8lmTLgZWTKGGdfiwJBlj/PwY451jjP8cY/z2GOOvqupCVf1uVb2pqt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AEATWp8AAAD2jHao3afNaXtJ1AAAAAA0IVEDAADA3l/SexdI0ewGiRoAAACAJhRqAAAAAJrQ+gQAAMB9HNVCoy1qOlqb9oNEDQAAAEATEjUAAACcmEt7b4b0zP6SqAEAAABoQqEGAAAAoAmtTwAAAJzLcW06WqMeSGsTh5GoAQAAAGhCoQYAAACgCa1PAAAArNVJ23x2oUVKSxPnJVEDAAAA0IREDQAAAC2sKo1ylmSOJAxdSNQAAAAANKFQAwAAANCE1icAAAB2ykFtTNePu2b3XdXiRG8SNQAAAABNKNQAAAAANKFQAwAAANCEQg0AAABAEwo1AAAAAE0o1AAAAAA0oVADAAAA0IRCDQAAAEATCjUAAAAATSjUAAAAADShUAMAAADQhEINAAAAQBMKNQAAAABNKNQAAAAANKFQAwAAANCEQg0AAABAEwo1AAAAAE0o1AAAAAA0oVADAAAA0IRCDQAAAEATCjUAAAAATSjUAAAAADShUAMAAADQhEINAAAAQBMKNQAAAABNKNQAAAAANKFQAwAAANCEQg0AAABAEwo1AAAAAE0o1AAAAAA0oVADAAAA0IRCDQAAAEAT1029gHW48earUy+BHeb8gu3nfcw6Ob8AgPOQqAEAAABoQqEGAAAAoAmFGgAAAIAmFGoAAAAAmlCoAQAAAGhCoQYAAACgCYUaAAAAgCYUagAAAACaUKgBAAAAaEKhBgAAAKAJhRoAAACAJhRqAAAAAJqoMcbhd1bdneQ1m1sOwNZ4zBjj/adexNTsEwCHsk/EPgFwhEP3iSMLNQAAAABsjtYnAAAAgCYUagAAAACaUKgBAAAAaEKhBgAAAKAJhRoAAACAJv4PyHxXXISeWgsAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 1440x648 with 3 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "activity.display(res = res)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3f7143b714674aceb1d36dc6c759693a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "VBox(children=(VBox(children=(HBox(children=(Label(value='levels:'), FloatSlider(value=0.1, max=1.0, step=0.00…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "VolumeRenderer(activity,res=res).display()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
